﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InnovTech.Persistence
{
    public interface IDatabaseAccess : IDaoProvider
    {
        void RegisterEntity<EType>();
        void RegisterEntities(params Type[] entityTypeList);

        //Returns boolean
        bool CheckIsEntity<EType>();
        bool CheckIsEntity(object entity);

        //Throws exception
        void ValidateEntity<EType>();
        void ValidateEntity(object entity);

        ConnectionState ConnectionState { get; }
        ConnectionState Connect(IDatabaseInfo dbInfo);
    }

    public enum ConnectionState
    {
        Closed,
        Open,
        Broken
    }
}
